package com.mmy.service.ship.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.ship.TShipPortRepository;
import com.mmy.dao.ship.VShipPortRepository;
import com.mmy.domain.ship.TShipPort;
import com.mmy.domain.ship.VShipPort;
import com.mmy.service.ship.TShipPortService;

@Service
public class TShipPortServiceImpl implements TShipPortService {

	@Autowired
	TShipPortRepository tShipPortRepository;

	@Autowired
	VShipPortRepository vShipPortRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VShipPort> findAll() {
		// TODO Auto-generated method stub
		return vShipPortRepository.findAll();
	}

	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */
	public Object getMaxPortID() {
		// TODO Auto-generated method stub
		return tShipPortRepository.getMaxPortID();
	}

	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int portID) {
		// TODO Auto-generated method stub
		tShipPortRepository.save(portID);
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(TShipPort tShipPort) {
		// TODO Auto-generated method stub
		tShipPortRepository.save(tShipPort);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */
	public void delShipPort(List<Integer> lstPortID) {
		// TODO Auto-generated method stub
		tShipPortRepository.delShipPort(lstPortID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public TShipPort findByPortID(int iPortID) {
		// TODO Auto-generated method stub
		return tShipPortRepository.findByPortID(iPortID);
	}

	/**
	 * 通过name查找
	 * 
	 * @param
	 * @return
	 */
	public List<VShipPort> findByPortName(String strPortName) {
		// TODO Auto-generated method stub
		return vShipPortRepository.findByPortName(strPortName);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public List<VShipPort> findport(int zoneID) {
		// TODO Auto-generated method stub
		return vShipPortRepository.findport(zoneID);
	}

}
